<template>
	<view class="">
		<rich-text :nodes="content"></rich-text>
	</view>
</template>

<script>
	import {
		getUserServices,
		getSecret
	} from '@/api/public.js'
	export default {
		data() {
			return {
				content: '',
			}
		},

		onLoad() {
			const {
				title,
				type
			} = this.$Route.query
			uni.setNavigationBarTitle({
				title
			})
			this.loadData(type)
		},

		methods: {
			async loadData(type) {
				uni.showLoading({
					mask: true,
					title: '加载中...'
				})
				if (type == 'service') {
					const res = await getUserServices()
					this.content = res.dataid
				} else if (type == 'secret') {
					const res = await getSecret()
					this.content = res.dataid
				}
				uni.hideLoading()
			},
		}
	}
</script>

<style scoped lang="scss">
</style>